package thread;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:DELL
 * Date:2025-02-14
 * Time:23:45
 */

public class Demo3 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> queue =new LinkedBlockingQueue<>();
        //输入
        queue.put("111");
        queue.put("222");
        queue.put("333");
        queue.put("444");
        String elem=queue.take();
        System.out.println(elem);
        elem=queue.take();
        System.out.println(elem);
        elem=queue.take();
        System.out.println(elem);
        elem=queue.take();
        System.out.println(elem);
        elem=queue.take();
        System.out.println(elem);
    }
}
